# Biome 格式化插件

### 安装插件
import { PackageManagerTabs } from '@theme';

<PackageManagerTabs command="add @empjs/biome-config -D" />

### 配置插件
```ts title="biome.json"
{
  "extends": ["@empjs/biome-config"]
}
```

### vscode 建议配置
```json title=".vscode/settings.json"
{
  "eslint.enable": false,
  "editor.codeActionsOnSave": {
    "quickfix.biome": "explicit",
    "source.organizeImports.biome": "explicit"
  },
  "[json]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[javascript]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[typescript]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "biomejs.biome"
  }
}

```

:::info 💡 TIP
在根目录 `.npmrc` 加入 `public-hoist-pattern[]=*@biomejs/biome*`
:::

### biome 常用指令
```jsonc
// 项目代码修复
biome lint . --fix
// 项目代码检查
biome check .
```